package com.example.takeaway.api.common;

import com.example.takeaway.common.R;
import com.example.takeaway.model.PageVO;
import com.example.takeaway.model.dto.DishDTO;
import com.example.takeaway.model.dto.DishEditorDTO;
import com.example.takeaway.model.dto.DishPageQuery;
import com.example.takeaway.model.vo.DishVO;
import com.example.takeaway.service.DishService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 菜品表 前端控制器
 * </p>
 *
 * @author 邢晨旭
 * @since 2023-10-12
 */
@RestController
@RequestMapping("/public/dish")
public class DishPublicApi {

    @Resource
    DishService dishService;


    @GetMapping("/list/{id}")
    public R<List<DishVO>> list(@PathVariable("id") Long categoryId){
        return R.ok(dishService.queryList(categoryId));
    }

}
